package Pattern.order;

public class SimpleRemoteControl {
    Command slot;

    public SimpleRemoteControl() {
    }

    public void setCommand(Command command){
        this.slot=command;
    }

    public void buttonWasPressed(){
        slot.execute();
    }

    public static void main(String[] args) {
        SimpleRemoteControl simpleRemoteControl=new SimpleRemoteControl();
        Light light=new Light();
        LightCommand lightCommand=new LightCommand(light);
        simpleRemoteControl.setCommand(lightCommand);
        simpleRemoteControl.buttonWasPressed();
    }
}
